Skip to content

feat: add Google Cloud OIDC detector - #306

Merged
cloudsmith-iduffy merged 4 commits into
masterfrom
iduffy/gcp-oidc
Oct 5, 2026
Merged

cloudsmith-iduffy merged 4 commits into
masterfrom
iduffy/gcp-oidc

Conversation

@cloudsmith-iduffy

@cloudsmith-iduffy cloudsmith-iduffy commented Jun 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds Google Cloud OIDC authentication through cloudsmith-cli[gcp].

  • Supports attached service accounts, service-account keys, and impersonated ADC.
  • Falls back to IAM generateIdToken when the metadata identity endpoint returns 404; requires iam.serviceAccounts.getOpenIdToken.
  • Checks user-ADC audience compatibility and respects existing detector order/disable controls.

Validation

  • Live Cloud Build test authenticated as google-10rf in iduffy-demo and listed repositories successfully.

@cloudsmith-iduffy
cloudsmith-iduffy requested a review from a team as a code owner June 8, 2026 22:55
@cloudsmith-iduffy
cloudsmith-iduffy marked this pull request as draft June 8, 2026 22:57
@cloudsmith-iduffy
cloudsmith-iduffy changed the base branch from generic-oidc-detector to master June 8, 2026 23:01
@cloudsmith-iduffy
cloudsmith-iduffy force-pushed the iduffy/gcp-oidc branch 6 times, most recently from e8c47d0 to d8816e1 Compare June 10, 2026 14:06
@cloudsmith-iduffy
cloudsmith-iduffy force-pushed the iduffy/gcp-oidc branch 3 times, most recently from 60f4060 to ceeb715 Compare June 10, 2026 20:26
@cloudsmith-iduffy
cloudsmith-iduffy changed the base branch from master to iduffy/oidc-detector-controls June 10, 2026 20:26
Base automatically changed from iduffy/oidc-detector-controls to master June 11, 2026 09:37
@cloudsmith-iduffy
cloudsmith-iduffy force-pushed the iduffy/gcp-oidc branch 3 times, most recently from ebd441a to c964cf7 Compare September 29, 2026 11:20
@cloudsmith-iduffy
cloudsmith-iduffy marked this pull request as ready for review September 29, 2026 11:22
Copilot AI balanced review requested due to automatic review settings September 29, 2026 11:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Incompatible user ADC can shadow a valid generic OIDC token and cause authentication to fail.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds optional Google Cloud OIDC authentication through Application Default Credentials.

Changes:

  • Adds the GCP detector, dependency extra, and registration.
  • Supports metadata, IAM fallback, service-account, impersonated, and user credentials.
  • Adds tests and user documentation.
File Description
uv.lock Locks Google authentication dependencies.
README.md Documents GCP OIDC setup and behavior.
pyproject.toml Adds gcp and updates all extras.
cloudsmith_cli/​core/​tests/​test_generic_detector.py Accounts for GCP detector precedence.
cloudsmith_cli/​core/​tests/​test_gcp_detector.py Tests GCP detection and token flows.
cloudsmith_cli/​core/​credentials/​oidc/​detectors/​gcp.py Implements the GCP detector.
cloudsmith_cli/​core/​credentials/​oidc/​detectors/​__init__.py Registers GCP in detector order.
CHANGELOG.md Records the new feature.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cloudsmith_cli/core/credentials/oidc/detectors/gcp.py
@cloudsmith-iduffy

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts in this pull request

cloudsmith-iduffy and others added 3 commits October 5, 2026 18:46
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: cloudsmith-iduffy <178375997+cloudsmith-iduffy@users.noreply.github.com>
Co-authored-by: cloudsmith-iduffy <178375997+cloudsmith-iduffy@users.noreply.github.com>

Copilot AI commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved the conflicts by merging master in 46a316c, preserving both GCP and Buildkite OIDC support. Updated stale audience tests in 632c395. All 159 targeted tests and pre-commit checks pass; CodeQL found no alerts.

@cloudsmith-iduffy
cloudsmith-iduffy merged commit ce23961 into master Oct 5, 2026
23 checks passed
@cloudsmith-iduffy
cloudsmith-iduffy deleted the iduffy/gcp-oidc branch October 5, 2026 18:39
tigh-latte added a commit that referenced this pull request Oct 7, 2026
tigh-latte added a commit that referenced this pull request Oct 7, 2026
tigh-latte added a commit that referenced this pull request Oct 7, 2026
tigh-latte added a commit that referenced this pull request Oct 8, 2026
* Reapply "feat: add Buildkite OIDC credential detection (#415)"

This reverts commit 3b5c328.

* Reapply "feat: add Google Cloud OIDC detector (#306)"

This reverts commit f194d83.

* Potential fix for pull request finding 'Add Buildkite OIDC detector to the changelog'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants